{# One person's guide, live: where it was read from, then a tab each for the guide (each part with the lines its points rest on folded under them, each opening its meeting), their open threads with the owner (_threads.html), and the owner's own note with the guide written again. While it is being written it re-reads itself every few seconds. #} {% from "components/macros/layout.html" import facts, tab_panel, tabbed %} {% from "components/macros/form.html" import action, textarea %} {% from "pages/meetings/_macros.html" import heading %} {% from "pages/overseer/meetings/_threads.html" import quote_lines, thread_sections %} {% set guide = record.guide %} {% set hx_body = 'hx-target="#guide-body" hx-swap="outerHTML"' %}
{{ facts([ ("Owner", record.owner_user_id), ("Read from", guide.meetings ~ (" meeting" if guide.meetings == 1 else " meetings")), ("Written by", guide.model_name), ("Written", written), ]) }} {% if guide.error %}{% endif %} {% if record.writing %}

Writing the guide…

{% endif %} {% set open = "guide" %} {% call tabbed("guide", [("guide", "How to work with them"), ("threads", "Threads"), ("note", "Your note")], open) %} {% call tab_panel("guide", open) %} {% for section in record.sections %}
{{ heading(section.title) }} {% if section.points %} {% else %}

Nothing yet.

{% endif %}
{% endfor %} {% endcall %} {% call tab_panel("threads", open) %}{{ thread_sections(record.threads, said) }}{% endcall %} {% call tab_panel("note", open) %}
{{ textarea("note", guide.note, rows=3, placeholder="What you know of them that the meetings do not say: read with them the next time the guide is written.") }}
{{ action("Save the note", 'data-write hx-post="' ~ base ~ '/note" hx-include="#guide-body [name=note]" ' ~ hx_body) }} {% if record.can_write %}{{ action("Write it again", 'data-write-guide data-write hx-post="' ~ base ~ '/guide" ' ~ hx_body) }}{% endif %}
{% endcall %} {% endcall %}